CentOS 6
Sponsored Link

Puppet - How to Use [package resource]
2014/01/26
 
This is the exmaples for package resource.
[1] It manages the configuration to keep "httpd" is installed.
[root@dlp ~]#
vi /etc/puppet/manifests/site.pp
package { 'httpd':
    provider => yum,
    ensure   => installed,
}
[2] It manages the configuration to keep the "latest httpd" is installed.
[root@dlp ~]#
vi /etc/puppet/manifests/site.pp
package { 'httpd':
    provider => yum,
    ensure   => latest,
}
[3] It manages the configuration to keep "epel-release" is installed by rpm.
[root@dlp ~]#
vi /etc/puppet/manifests/site.pp
package { 'epel-release':
    provider => rpm,
    ensure   => installed,
    source   => 'http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm',
}
[4] It manages the configuration to keep "httpd" is not installed. (It deleted if installed)
[root@dlp ~]#
vi /etc/puppet/manifests/site.pp
package { 'httpd':
    provider => yum,
    ensure   => purged,
}
 
Tweet